package com.texaco.chapasFutbol.multiplayer.mensajes;

import java.util.Map;

import org.json.JSONException;

public class RequestUpdateMessage extends BaseMessage{
	
	private static final long serialVersionUID = -3525027119814818107L;
	private long idClient;
	
	public RequestUpdateMessage() throws JSONException{
		super(MESSAGE_REQUEST_UPDATE);
	}
	
	public RequestUpdateMessage(String jsonStr) throws JSONException{
		super(MESSAGE_REQUEST_UPDATE, jsonStr);
	}
	
	public RequestUpdateMessage(Map<String, String> jsonMap) throws JSONException{
		super(MESSAGE_REQUEST_UPDATE, jsonMap);
	}
	
	@Override
	protected void preRead() {
		try {
			idClient = getLong(FIELD_ID_CLIENT);
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}

	@Override
	protected void preWrite() {
		try {
			put(FIELD_ID_CLIENT, idClient);
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}

	public Long getIdClient() {
		return idClient;
	}

	public void setIdClient(Long idClient) {
		this.idClient = idClient;
	}
}
